<?php
/**
 * Created by PhpStorm.
 * User: cephei
 * Date: 12/18/15
 * Time: 2:24 PM
 */
namespace Plugins\BaiduSign;

use Core\PluginContainer;

class Register_BaiduSign{
    public function register(){
        PluginContainer::getInstance()->bind('baidusign',function(){
           return new Plugin_BaiduSign();
        });
    }
    public function install(\Closure $callback){
        $db = PluginContainer::getInstance()->singletonMake('database');
        $sql = file_get_contents(ROOT_PATH."/Plugins/BaiduSign/baidusign.sql");
        $db->exec($sql);
        $config = new \stdClass();
        $config->name = 'baidusign';
        $config->class = 'Plugins\\BaiduSign\\Register_BaiduSign';
        $config->enable = 1;
        $callback($config);
    }
}